/*
 * param.h
 *
 *  Created on: 2017年7月3日
 *      Author: zjm
 */

#ifndef TABS_PARAM_H_
#define TABS_PARAM_H_

struct param_data {
	const char *param;
	int (*cb)(struct mg_connection *nc);
};

struct action{
	const char *url;
	int (*cb)(struct mg_connection *nc,struct http_message *hm);
};

#define PARAM_ITEM(n)	{.param=#n,.cb=n}

#include "system.h"
#include "mqtt.h"
#include "device.h"
#include "gprs.h"

#define PARAM_LIST	\
MQTT_PARAM_LIST \
SYSTEM_PARAM_LIST \
DEVICE_PARAM_LIST \
GPRS_PARAM_LIST

int null(struct mg_connection *nc,struct http_message *hm);

#define ACTION_ITEM(n)	{.url="/"#n,.cb=n}

#define ACTION_DUMMY	ACTION_ITEM(null)

#define ACTION_LIST	\
SYSTEM_ACTION_LIST \
MQTT_ACTION_LIST \
DEVICE_ACTION_LIST \
GPRS_ACTION_LIST

#endif /* TABS_PARAM_H_ */
